
class Context {
    public Strategy Strategy;

    public void show() {
        this.Strategy.show();
    }
}

public abstract class Strategy {
    public static void main(String[] args) {
        Context ctx = new Context();
        ctx.Strategy = new StrategyA();
        ctx.show();

        ctx.Strategy = new StrategyB();
        ctx.show();
    }

    public abstract void show();
}

class StrategyA extends Strategy {
    @Override
    public void show() {
        System.out.println("StrategyA.show()");
    }
}

class StrategyB extends Strategy {
    @Override
    public void show() {
        System.out.println("StrategyB.show()");
    }
}